<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事实搜索</title>
</head>
<body>
    <form>
        搜索框:<input type="text" size="30" value=""  onkeyup="showResult(this.value)">
    </form>
    <div id="show"></div>
</body>
</html>
<script type="text/javascript" src="/Public/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
    function showResult(str)
    {
        var xmlhttp;
        if(str.length == 0)
        {
            $('#show').html('');
            $('#show').css('border','0px');
            return;
        }
        if(window.XMLHttpRequest)
        {
            xmlhttp = new XMLHttpRequest();
        }else{
            xmlhttp = new ActiveXObject();
        }
        xmlhttp.onreadystatechange = function()
        {
            if(xmlhttp.readyState = 4 && xmlhttp.status == 200)
            {
                $('#show').html(xmlhttp.responseText);
                $('#show').css('border','1px solid #A5ACB2');
            }
        }
        xmlhttp.open("GET","/Home/Texiao/search?param="+str,true);
        xmlhttp.send();
    }
    $(document).ready(function(){
        $('.a').on('click',function(){
            alert(111);
//            $('input').val(name);
        });
    });


</script>